package cn.xopencode.appletweb.controller.score.modification;

import cn.xopencode.common.framework.validator.InEnum;
import cn.xopencode.common.framework.vo.CommonResult;
import cn.xopencode.score.api.enums.innovate.SuggestScoreEnum;
import cn.xopencode.score.api.rpc.ScoreRpc;
import cn.xopencode.securityservice.enums.suggest.SuggestLevelEnum;
import cn.xopencode.securityservice.rpc.suggest.dto.SuggestCreateReqDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

@Api(tags = "积分修改情况 API")
@RestController
@RequestMapping("/modification")
@Validated
public class ScoreModificationController {
    @DubboReference(version = "${dubbo.consumer.ScoreRpc.version}")
    private ScoreRpc scoreRpc;

    /**
     *  创建建议传入级别，返回总分数
     * @param createDTO
     * @return
     */
    @PostMapping("/updateSuggest")
    @ApiOperation("新增创新与合理化建议情况")
    public CommonResult<Double> createSuggest(@Valid SuggestCreateReqDTO createDTO){

        Double score = scoreRpc.addSuggestScore(createDTO);
        return null;
    }
}
